Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 2 - Geometric Shapes / Using Geometric Shapes


Creating and Drawing Empty Shapes and Full Shapes

To create an empty shape or a full shape, you use the function GXNewShape, which is described in full in the chapter "Shape Objects" of Inside Macintosh: QuickDraw GX Objects.

To create an empty shape, you could define a shape reference and then call the GXNewShape function:

gxShape anEmptyShape;

anEmptyShape = GXNewShape(gxEmptyType);
Although you can draw this shape with the GXDrawShape function, nothing will appear. However, you can use empty shapes for other purposes. For example, you can create an empty shape and then add geometric points to it using the SetShapeParts function, building other types of shapes as you add points. See "Editing Shape Parts" beginning on page 2-93 for examples of this function.

To create a full shape, you can use this code:

gxShape aFullShape;

aFullShape = GXNewShape(gxFullType);
You can then draw the full shape to cover the entire area of the shape's view ports. For example, you could use the full shape to erase an area, or you could set the color of the full shape and draw it to create a colored background before drawing other shapes.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help